Repository navigation
Let export_query and export_table_query accept an explicit null filename - #21
Open
vishalhabib99 wants to merge 1 commit into
Open
vishalhabib99 wants to merge 1 commit into
vishalhabib99 wants to merge 1 commit into
Conversation
Both tools annotate filename as `str = None` and already treat None as
"generate a name". The schema then advertised "default": null on a
string-only field, and FastMCP rejected {"filename": null} before the
tool ran. Annotate it `str | None`.
Adds a test that every query tool parameter defaulting to None allows null.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Hi, a quick follow-up. This still applies cleanly on main. It's two annotations ( |
Author
|
Hi! Just a gentle follow-up on this PR. It's ready from my side, and I'm happy to make any changes you'd like. Thanks for taking a look! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
export_queryandexport_table_queryannotatefilenameasstr = None, and both already treatNoneas "generatedump_<id>_<timestamp>". FastMCP turns that into{"default": null, "type": "string"}, so a client that sends the advertised default explicitly ({"filename": null}) is rejected before the tool runs.Found with mcp-doctor (
none_default_type), then reproduced with an in-memoryfastmcp.Clienton fastmcp 4.0.11 / mcp 2.3.0 (whatfastmcp>=2.8.1resolves to today), no IoTDB running:Before:
After (
str | None = None):Changes:
services/query.py:filename: str | None = Noneon both tools. Nothing else.tests/test_tool_schemas.py: registers the query tools on a realFastMCPand checks that every parameter defaulting toNoneallowsnull. It fails on the current branch with['export_query.filename', 'export_table_query.filename']and passes with this change.pytest tests: 93 passed, 26 subtests passed.🤖 Generated with Claude Code